﻿using Microsoft.AspNetCore.Mvc;
using WxBean.Core.Controllers;
using WxBean.Core.IServices;
using WxBean.Core.Model;
using WxBean.Core.Model.Models;

namespace WxBean.Core.Api.Controllers
{
    [Route("api/[Controller]/[action]")]
    [ApiController]
    public class VideoController : BaseApiController
    {
        private IVideoService _videoService { get; set; }
        public VideoController(IVideoService videoService)
        {
            _videoService = videoService;
        }

        /// <summary>
        /// 检索 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [HttpGet("search")]
        public async Task<MessageModel<IEnumerable<VideoModel>>> GetVideoAsync(string name)
        {
            return await _videoService.ExecuteAsync(name);
        }
    }
}
